package editorwords.editors;

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.IWhitespaceDetector;
import org.eclipse.jface.text.rules.IWordDetector;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;
import org.eclipse.jface.text.rules.WordRule;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;

class FicheReleaseScanner extends RuleBasedScanner {
	
    public FicheReleaseScanner(ColorManager manager) {
       //Token keyword = new Token(new TextAttribute(manager.getColor(ColorConstants.PROC_INSTR)));
       Token comment = new Token(new TextAttribute(manager.getColor(ColorConstants.COMMENT)));
       Token mantisToken	= new Token(new TextAttribute(manager.getColor(ColorConstants.MANTIS)));       
       Display display = Display.getCurrent();
       Token keyWordToken = new Token(new TextAttribute(manager.getColor(ColorConstants.KEYWORD)));
       TeteWordRule mantisNumberRule = new TeteWordRule(mantisToken);
       
       setRules(new IRule[] {
          //keyWordRule,
          //sectionFicheRealeaseRule,
          //sectionRule,
          //FichierSQLRule,
          mantisNumberRule,
          new ReponseWordRule(new Token(new TextAttribute(manager.getColor(ColorConstants.REPONSE)))),
          new SingleLineRule("#", null, comment),
          //new SingleLineRule("\"", "\"", string, '\\'),
          //new SingleLineRule("'", "'", string, '\\'),
          //hexNumberRule,
          new WhitespaceRule(new IWhitespaceDetector() {
             public boolean isWhitespace(char c) {
                return Character.isWhitespace(c);
             }
          }),
          
       });
    }
    
 }
